<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<script>

  // document.write("<h1>这是一个标题</h1>");
  // document.write("<p>这是一个段落</p>");
  var a = true;
  var b = 3;

  var obj = {
      age:20,
      name:'jack'
  }


  function fun1() {
    alert(a+b);
    alert(obj.name)
  }

  function fun2(){
    document.getElementById("t").innerHTML="这是一个标题"
  }

  function fun3(){
      alert("function 3")
  }
  console.log(a);

</script>
<body>
<button onclick="fun1()">点击</button>
<a href="https://www.baidu.com/">百度</a>
<h1 id="t">this is a title</h1>
<button onclick="fun2()">点击</button><br>
<input type="text" onmousemove="fun3()">
<p onkeydown="fun3()">on key down</p>

</body>
</html>